package cn.edu.sgu.www.mhxysy.dto.gang;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Positive;
import java.time.LocalDate;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class GangMemberDTO implements DataTransferObject {

    @NotBlank(message = "成员ID" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "成员ID", required = true)
    private String id;

    /**
     * 成员名字
     */
    @NotBlank(message = "成员名字" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "成员名字", required = true)
    private String name;

    /**
     * 角色造型ID
     */
    @Positive(message = "角色造型ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "角色造型" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "角色造型ID", required = true)
    private Integer roleId;

    /**
     * 门派ID
     */
    @Positive(message = "门派ID" + CustomMessages.ILLEGAL)
    @NotNull(message = CustomMessages.SCHOOL_ID_NOT_NULL)
    @ApiModelProperty(value = "门派ID", required = true)
    private Integer schoolId;

    /**
     * 角色等级
     */
    @Range(min = 1, max = 115, message = "角色等级" + CustomMessages.ILLEGAL)
    @NotNull(message = "角色等级" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "角色等级", required = true)
    private Integer grade;

    /**
     * 帮派职务ID
     */
    @Positive(message = "帮派职务ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "帮派职务" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "帮派职务ID", required = true)
    private Integer jobId;

    /**
     * 帮派ID
     */
    @NotNull(message = "帮派" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "帮派ID", required = true)
    private String gangId;

    /**
     * 本周帮贡
     */
    @Positive(message = "帮派职务ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "本周帮贡" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "本周帮贡", required = true)
    private Integer bzbg;

    /**
     * 现有帮贡
     */
    @Positive(message = "现有帮贡" + CustomMessages.ILLEGAL)
    @NotNull(message = "现有帮贡" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "现有帮贡", required = true)
    private Integer xybg;

    /**
     * 历史帮贡
     */
    @NotNull(message = "历史帮贡" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "历史帮贡", required = true)
    private Integer lsbg;

    /**
     * 入帮时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @Past(message = "入帮时间" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "入帮时间", required = true)
    private LocalDate enterTime;

    /**
     * 离线时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @Past(message = "离线时间" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "离线时间", required = true)
    private LocalDate lastOnline;
}